package config

import (
	"fmt"
	"github.com/spf13/viper"
)

type Nachos struct {
	NamespaceId string
	IpAddr      string
	Port        int
	DataId      string
	Group       string
}
type AlLConf struct {
	Nachos
}

var ViperData AlLConf

func InitViper() {
	viper.SetConfigFile("../common/config/dev.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		panic(err)
	}
	err = viper.Unmarshal(&ViperData)
	if err != nil {
		panic(err)
	}
	fmt.Println("init viper success")
}
